﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel;

namespace Xinnos.Lca.Yacht.Analyzer.View
{
    internal class ConfigurationViewModel:INotifyPropertyChanged
    {
        private static ConfigurationViewModel mInstance = null;
        public event PropertyChangedEventHandler PropertyChanged;
        private GraphConfigurationViewModel mGraph = null;
        private string mObject = null;

        public GraphConfigurationViewModel Graph
        {
            get { return mGraph; }
            set
            {
                mGraph = value;
                RaisePropertyChanged("Graph");
            }
        }
        public string Object
        {
            get { return mObject; }
            set
            {
                mObject = value;
                RaisePropertyChanged("Object");
            }
        }

        private ConfigurationViewModel()
        {
            if (null == mGraph) mGraph = new GraphConfigurationViewModel();
            this.Object = "Object";
        }
        public static ConfigurationViewModel GetInstance()
        {
            if (null == mInstance) mInstance = new ConfigurationViewModel();
            return mInstance;
        }

        private void RaisePropertyChanged(string strPropertyName)
        {
            PropertyChangedEventHandler _handler = this.PropertyChanged;
            if (null != _handler) _handler(this, new PropertyChangedEventArgs(strPropertyName));
        }
    }
}